<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="myDiv" data-appId="12345" data-myName="Nicholas" data-login-bar="ok"></div>
<script>
    /*
        自定义属性,通过dataset来访问
        data-appId  和data-appid  通过appid访问
        data-app-id 和data-app-Id 通过appId访问
     */
    let div = document.getElementById('myDiv')
    console.log(div.dataset)  // {appid:12345,myname:Nicholas}
    const {appid,myname,loginBar} = div.dataset
    console.log(appid,myname,loginBar)
</script>
</body>
</html>